Tags: primary key object des SYS exist ODI one-key cmd atiRecently in the collation of things about MySQL, to write down some things to record, in order to query and browse later, the following are some of the operational skills.Add a table fieldALTER TABLE table1 add transactor varchar (ten) not Null;ALTER TABLE table1 add ID int unsigned not Null auto_increment primary keyModify the field type of a table
Tags: style http color io strong for AR artAdd a table fieldALTER TABLE table1 add transactor varchar (ten) not Null;ALTER TABLE table1 add ID int unsigned not Null auto_increment primary keyModify the field type of a table and specify empty or non-emptyALTER TABLE name change field Name field Name field type [whether non-null allowed];ALTER TABLE name modify field Name field type [allow non-null];ALTER TAB
Tags: style http color io strong for AR Art Div www.169it.comAdd a table fieldALTER TABLE table1 add transactor varchar (ten) not Null;ALTER TABLE table1 add ID int unsigned not Null auto_increment primary keyModify the field type of a table and specify empty or non-emptyALTER TABLE name change field Name field Name field type [whether non-null allowe
--alter table Historydata drop constraint Pk_historydataALTER TABLE HISTORYDATA ADD constraint Pk_historydata primary key (Collectiontime,code)Change primary keyDelete from Historydata where collectiontime between ' 2014-09-01 00:00:00 ' and ' 2014-11-01 00:00:00 ' and ID not in (Select ID from (Select Code,collectiontime,max (ID) ID from historydatawhere collect
How to Use pt-online-schema-change to change the primary key of a MySQL table, ptonlinechangeschema
When the service runs for a period of time and finds that the original primary key settings are not reasonable, you want to change the pr
insert a value of INSERT into test1 values (' 1′, ' We love you very much '); The column was then modified: ALTER TABLE test1 Modify (name VARCHAR2 (8)); You will get the error: Error on line 2nd: ORA-01441: Cannot reduce column length because some values are too large --------------------------------------------------------------------------------------------------------------- Advanced usage: Renaming a table ALTER TABLE table_name RENAME to New_table_name; Modify the name of a column Syntax
--alter table Historydata Drop constraint pk_historydata--delete primary keyALTER TABLE HISTORYDATA ADD constraint Pk_historydata primary KEY (Collectiontime,code)--Change primary keyDelete from Historydata where collectiontime between ' 2014-09-01 00:00:00 ' and ' 2014-11-01 00:00:00 ' and ID not in (Select ID from (S
Insert on Dumplicate Update when the primary key is the same update, the contents of the update change to 1
Multiple contents of update are separated by commas ... And notmysql> insert INTO ' 200702 ' (' Domain ', ' 2nd_domain ', ' TLD ', ' query_ns1 ', ' query_ns2 ', ' report_date ') VALUES (' DNSPOD.C Om ', ' dnspod ', ' com ', 1000, Watts, ' 2007-02-04 ') on DUPLICATE KEY UPDATE ' query_ns1 ' = ' query
=NewSqlsessionfactorybuilder (). build (reader); //provides a way to get to the session Public StaticSqlsession getsession ()throwsioexception{System.out.println ("22222" +factory); //The disadvantage is that the factory is//What the hell did 1.1 opensession do?sqlsession session =factory.opensession (); System.out.println ("3333"); returnsession; }}Single Test Public classMyTest {Istudentdao dao; @Before Public voidInitData ()throwsioexception{DAO=NewStudentdaoimpl (); } /*** Fuzz
Company all servers finally put to the same room, opened the intranet access. This way, you have to change the configuration of some MySQL from the server
and become intranet access.
BackupThe first is to shut down the MySQL server (slave end) and backup configuration information
The code is as follows
Copy Code
Service Mysqld Stop
The code is as follows
Copy Code
#进入到mysql目录Cd/var/li
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.